//
//  APPLEEmoticonCollectionView.swift
//  123
//
//  Created by pangjiaxing on 16/1/13.
//  Copyright © 2016年 pangjiaxing. All rights reserved.
//

import UIKit

class APPLEEmoticonCollectionView: UICollectionView {

    override init(frame: CGRect, collectionViewLayout layout: UICollectionViewLayout) {
        super.init(frame: frame, collectionViewLayout: UICollectionViewFlowLayout())
        setupUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func setupUI(){
        backgroundColor = UIColor.clearColor()
        let layout = collectionViewLayout as! UICollectionViewFlowLayout
        layout.scrollDirection = .Horizontal
        layout.minimumInteritemSpacing = 0
        layout.minimumLineSpacing = 0
        pagingEnabled = true
        showsHorizontalScrollIndicator = false
        bounces = false
        
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        let layout = collectionViewLayout as! UICollectionViewFlowLayout
        layout.itemSize = CGSize(width: mainScreenW, height: self.frame.height)
        
    }
    
}
